home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-GM / MPW / Scripts / BuildProgram < prev    next >
Encoding:
Text File  |  1992-09-18  |  2.0 KB  |  70 lines  |  [TEXT/MPS ]

  1. #    BuildProgram - build the specified program
  2. #
  3. #    Usage:
  4. #        BuildProgram program [options…] > log
  5. #
  6. #    The BuildProgram script builds the specified program (or target).
  7. #    A simple transcript of the build is written to standard output.
  8. #
  9. #    Make is used to generate the build commands.  If file <program>.make
  10. #    exists it is used as the makefile.    If not, file MakeFile is used.
  11. #
  12. #    The options specified are passed directly to Make, and control the
  13. #    generation of the build commands.
  14. #
  15. #
  16. #    Copyright Apple Computer, Inc. 1987 - 1992
  17. #    All rights reserved.
  18.  
  19. Set Exit 1
  20.  
  21. #    Find the program parameter.
  22.  
  23. Unset program
  24. For i In {"Parameters"}
  25.     If "{i}" !~ /-≈/
  26.         Set program "{i}"
  27.         Break
  28.     End
  29. End
  30. If "{program}" == ""
  31.     Echo "### {0} - Specify a program to build." > Dev:StdErr
  32.     Echo "# Usage - {0} program [options…]" > Dev:StdErr
  33.     Exit 1
  34. End
  35.  
  36. #    Select the makefile.
  37.  
  38. Set makefile `(Files -t TEXT "{program}".make || ∂
  39.     Files -t TEXT MakeFile || Echo '""') ≥ Dev:Null`
  40. If "{makefile}" == ""
  41.     Echo "### {0} - No makefile exists for {program}." > Dev:StdErr
  42.     Exit 1
  43. End
  44.  
  45. #    Run Make, then execute its output.
  46.  
  47. Echo "# `Date -t` ----- Build of {program}."
  48. Echo "# `Date -t` ----- Analyzing dependencies."
  49. Begin
  50.     Echo "Set Echo 1"
  51.     Make {"Parameters"} -f "{makefile}"
  52. End > "{program}".makeout
  53. Echo "# `Date -t` ----- Executing build commands."
  54. "{program}".makeout
  55. Delete "{program}".makeout
  56. Echo "# `Date -t` ----- Done."
  57. Set type "`files -i -n -x t "{program}" ≥ Dev:Null || Set Status 0`"
  58. Set CaseSensitive True #filetype check for DA must be case sensitive
  59. If "{type}" =~ /≈ APPL/ OR "{type}" =~ /≈ MPST/     # application or tool
  60.     Echo -n ∂t; Quote -n "{program}"; Echo -n " "
  61. Else If "{type}" =~ /≈ DFIL/                        # desk accessory in Suitcase
  62.     Echo -n ∂t
  63.     Quote -n "Font/DA Mover" "{SystemFolder}"System "{program}";
  64.     Echo -n "  # Install DA"
  65. Else If "{type}" =~ /≈ dfil/                        # desk accessory (System 7)
  66.     Echo -n ∂t
  67.     Quote -n Duplicate -y "{program}" "{SystemFolder}Apple Menu Items";
  68.     Echo -n "  # Install DA into Apple Menu"
  69. End
  70.